package org.example.day;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/08/13 9:46
 */
public class Solution3151 {

    public boolean isArraySpecial(int[] nums) {
        boolean res = true;
        boolean flag = nums[0]%2==0;

        for (int i = 1; i < nums.length; i++) {
            if(i%2 == 0 && (nums[i]%2==0 != flag)){
                res = false;
                break;
            } else if (i%2 != 0 && (nums[i]%2==0 == flag)) {
                res = false;
                break;
            }
        }

        return res;
    }

}
